Repository navigation
Restore gmux_backlight brightness on wake when hardware diverges - #20354
JamesCaudill wants to merge 3 commits into
Conversation
On dual-GPU Macs, gmux resets the panel backlight (commonly to 80%) when the panel powers down after deep S3 suspend while leaving the kernel's requested brightness unchanged. Re-apply the requested brightness in omarchy-system-wake whenever gmux_backlight's actual_brightness diverges from brightness. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
[Low impact] The PR appears safe to merge, with no new blocking issues found. SummaryRestores
Reviews (5) · Last reviewed commit: "Wait for brightness adjustments before r..." · Reviewed by Greptile |
Use brightnessctl set +0 so brightnessctl re-reads the current kernel brightness rather than writing a stale value, and take a non-blocking flock on omarchy-brightness-display.lock to skip restoring while a display brightness change is already in progress. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
An external display adjustment holds the shared brightness lock without updating gmux. Skipping the wake restore while that lock is held leaves the internal panel at its reset level. Wait for the adjustment and then reapply the current requested level. Co-Authored-By: GPT-6 High (Codex) <noreply@openai.com>
|
Reviewed at Pushed I also compared #9189, #12423, #16718 and #18775. Their restores require a level saved by an earlier blank; this change can repair divergence without that snapshot, including a reset at resume itself. The issue already links here through @josemiguelo, this still needs confirmation on the affected Mac at the full SHA above. The author's hardware report is useful, but neither you nor a maintainer has confirmed this revision. To try this head's runtime change on a packaged install using cp /usr/bin/omarchy-system-wake /tmp/omarchy-system-wake-before-20354
curl -fsSL https://raw.githubusercontent.com/JamesCaudill/omarchy/411829523ad31714d4823456ee5faf6a618eed2e/bin/omarchy-system-wake -o /tmp/omarchy-system-wake-20354
sudo install -m755 /tmp/omarchy-system-wake-20354 /usr/bin/omarchy-system-wakeRepeat deep suspend → resume → lock-screen blank → key wake at low brightness, and report |
|
On current @josemiguelo, on a build with those changes, could you check whether |
Fixes #13890
Summary
On dual-GPU Macs using
gmux_backlight, the gmux firmware resets the hardware backlight to 80% (actual_brightness=52428/65535) when the panel powers down after deep S3 suspend while leaving the kernel's requestedbrightnessunchanged. Becauseapple-gmuxis not tied to the GPU's DPMS power sequence, nothing re-sends the requested level when the panel wakes.This adds
restore_gmux_backlighttobin/omarchy-system-wake:/sys/class/backlight/gmux_backlightis absent orbrightness == actual_brightness.actual_brightness != brightness, re-applies the kernel's requestedbrightnessviabrightnessctl -d gmux_backlight set "$requested".omarchy-system-wakerather than after the DPMS dispatch inomarchy-brightness-display on, so it still runs whenkey_press_enables_dpmshas already lit the panel andomarchy-brightness-display onexits early.Verification
Tested live on a 2019 16-inch MacBook Pro (
MacBookPro16,1, Intel Core i9-9980HK, Intel UHD 630 + AMD Radeon Pro 5500M,linux-t27.2.15-arch1-1-t2,mem_sleep_default=deep):hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })'for 3s thenenablekeptbrightness=9830andactual_brightness=9830(confirming plain DPMS blanking without suspend does not trigger the reset).gmux_backlightdiverged tobrightness=9830 actual=52428 max=65535(80%).omarchy-system-wakeinstalled at/usr/bin/omarchy-system-wake, repeating the full deep S3 suspend → resume → lock-screen blank → key-press wake cycle restoredgmux_backlighttobrightness=9830 actual=9830 max=65535(no 80% flash/stuck brightness).test/shell.d/brightness-display-test.sh(all checks pass).